<!DOCTYPE html>
<html lang="en">
<head>
    <title>商业用户</title>
    <link href="/static/index/css/font-awesome.min.css" rel="stylesheet" type="text/css" media="all"/>
    <!-- fontawesome -->
    <link href="/static/index/css/bootstrap.min.css" rel="stylesheet" type="text/css" media="all"/>
    <!-- Bootstrap stylesheet -->
    <link href="/static/index/css/style.css" rel="stylesheet" type="text/css" media="all"/>
    <link rel="stylesheet" href="/static/index/reset.css" type="text/css">
    <link rel="stylesheet" type="text/css" href="/static/index/css/toastr.min.css" />
    <link href="/static/index/js/layui/css/layui.css" rel="stylesheet">


    <!-- stylesheet -->
    <!-- meta tags -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="keywords" content=""/>
    <script type="application/x-javascript"> addEventListener("load", function () {
        setTimeout(hideURLbar, 0);
    }, false);

    function hideURLbar() {
        window.scrollTo(0, 1);
    } </script>
    <!-- //meta tags -->
    <!--fonts-->
    <link href="http://fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700,700i&subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese"
          rel="stylesheet">
    <link href="http://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
    <!--//fonts-->
    <script type="text/javascript" src="/static/index/js/jquery-2.1.4.min.js"></script>
    <script src="/static/index/js/main.js"></script>
    <!-- Required-js -->
    <!-- start-smoth-scrolling -->
    <script type="text/javascript" src="/static/index/js/move-top.js"></script>
    <script type="text/javascript" src="/static/index/js/easing.js"></script>
    <script type="text/javascript">
        jQuery(document).ready(function ($) {
            $(".scroll").click(function (event) {
                event.preventDefault();
                $('html,body').animate({scrollTop: $(this.hash).offset().top}, 1000);
            });
        });
    </script>

    <!-- start-smoth-scrolling -->

    <!-- scriptfor smooth drop down-nav -->
    <script>
        $(document).ready(function () {
            $(".dropdown").hover(
                function () {
                    $('.dropdown-menu', this).stop(true, true).slideDown("fast");
                    $(this).toggleClass('open');
                },
                function () {
                    $('.dropdown-menu', this).stop(true, true).slideUp("fast");
                    $(this).toggleClass('open');
                }
            );
        });
    </script>

    <!-- //script for smooth drop down-nav -->
</head>
<body>
{empty name="id"}
<nav class="navbar navbar-default navbar-fixed-top aa" style="margin-bottomo:100px;">
    <div class="container">
        <!--登录按钮-->
        <a href="{:url('index/login/index')}" style="margin-left: 1050px;color: black;">登录</a>


        <!--//注册按钮-->
        <a href="{:url('index/index/add')}" style="color: black;margin-left: 15px;">注册</a>
    </div>
</nav>
{else /}
<nav class="navbar  navbar-fixed-top" role="navigation" style="background: #e0620d ;padding-top: 3px;height:50px;">
    <div class="container-fluid" style="background: #fff;">
        <div class="navbar-header ">
	 <a class="navbar-brand " href="{:url('/index/index/index')}">返回首页</a>
            <button type="button" class="navbar-toggle" data-toggle="collapse"
                    data-target="#my-navbar-collapse">
                <span class="sr-only">切换导航</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>

        </div>
        <form class="navbar-form navbar-left" role="search" action="{:url('/wbSearch')}" method="post">
            <div class="form-group">
                <input type="text" class="form-control" name="Search" placeholder="微博找人">
                <button class="glyphicon glyphicon-search btn_search btn btn-default" ></button>
                <!--  <button type="submit" class="btn btn-default">提交</button> -->
            </div>

        </form>

        <div class="collapse navbar-collapse" id="my-navbar-collapse">
            <ul class="nav navbar-nav navbar-right" >
                <li >
                    <img src="{$pto['photo']}" width="30px" style="border-radius: 50%">
                    <a href="{:url('index/dologin')}" style="color: black;padding: 0px!important;" class="mingzi">{$user}</a>
                </li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        安全中心<b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                        <a href="{:url('index/login/loginOut')}" class="roll-nav roll-right J_tabExit tuichu" style="width: 50">
                            &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <i class="fa fa fa-sign-out"></i>
                            退出</a><br>

                        <a href="{:url('/editpass')}">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp更改密码</a>
                    </ul>

                </li>
            </ul>
        </div>
    </div>
    <hr style="margin: 0;padding: 0;color:#222;width: 100%">
</nav>
{/empty}
<hr>
<br><br>
<!-- header -->
<header>

    <div class="w3layouts-top-strip" style="margin-top: 100px;">

        <div class="container">
            <div class="logo">

                <img src="{$info['photo']}" class="img-circle" style="width: 100px">
                <h3><a href="#">{$info['username']}</a></h3>


            </div>

        </div>
    </div>

</header>

<div class="breadcrumbs">
    <div class="container">
        <div class="row readcrumb breadcrumb1 animated wow fs16 cf" data-wow-delay=".5s">

            <input type="hidden" id="attentId" value="{$attentId}">


       

            <div class="col-md-1" id="attent">
                <!-- Single button -->
                <div class="btn-group">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
                            aria-haspopup="true" aria-expanded="false">
                        <span class="glyphicon glyphicon-ok">&nbsp已关注</span><span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <button type="button" class="btn btn-default " style="border: #fff;margin-left: 35px"
                                    onclick="delAttent()">&nbsp取消关注
                            </button>
                        </li>
                    </ul>
                </div>
            </div>

            <div class="col-md-1" id="bothAttent">
                <div class="btn-group">
                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
                            aria-haspopup="true" aria-expanded="false">
                        <span class="glyphicon glyphicon-heart">&nbsp相互关注</span><span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <button type="button" class="btn btn-default " style="border: #fff;margin-left: 35px"
                                    onclick="delAttent()">&nbsp取消关注
                            </button>
                        </li>
                    </ul>
                </div>
            </div>


            <div class="col-md-1"></div>
            <div class="col-md-1">
            </div>
            <div class="col-md-1"></div>
            <div class="col-md-1"><a href="{:url('/business', ['attentId'=>$attentId])}" class="cf">主页</a></div>
            <div class="col-md-1"></div>
            <div class="col-md-1"><a href="{:url('/business/server', ['attentId'=>$attentId])}" class="cf">服务</a></div>
            <div class="col-md-1"></div>
            <div class="col-md-1"><a href="{:url('/business/photo', ['attentId'=>$attentId])}" class="cf">相册</a></div>
            <div class="col-md-3"></div>


        </div>


    </div>
</div>
<!-- //breadcrumbs -->

<div class="container">
    <div class="banner-btm-agile">

        <!-- //btm-wthree-left -->
        <div class="col-md-9 btm-wthree-left">
            {empty name="bad"}
            {else /}
            <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
                <!-- Wrapper for slides -->

                <div class="carousel-inner" role="listbox">

                    <div class="item active">
                        <img src="/upload/20190214/timg.jpg"
                             style="width: 783px;height: 400px;">
                        <div class="carousel-caption">

                        </div>
                    </div>
                    {volist name="$bad" id="v"}

                    <div class="item">

                        <img src="{$v['path']}" style="width: 783px;height: 400px;">

                        <div class="carousel-caption">
                            ...
                        </div>
                    </div>
                    {/volist}


                </div>


                <!-- Controls -->
                <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
                    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                    <span class="sr-only">Previous</span>
                </a>
                <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
                    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                    <span class="sr-only">Next</span>
                </a>
            </div>
            {/empty}
            <div class="agileits_heading_section">

            </div>
            <!-- wthree-top -->
            <div class="wthree-top-6">

            </div>
            <!-- //wthree-top -->
            {volist name="message" id="v"}
            {empty name="v['src_id']"}
            <div class="col-md-12"style="border: 1px solid #FFAC3A;width: 100% ;padding: 20px;">
                <div class="col-md-12" >

                    <div class="col-md-1" >

                        <div class="comments-grid-left" >
                            <img src="{$v['photo']}" style="width: 48px;height: 48px;"/>
                        </div>
                    </div>
                    <div class="col-md-11" style="margin-bottom: 10px">
                        <br>
                        <h5  style="margin-left:50px;font-size: 16px;color:#FFAC3A;">{$v['username']}</h5>
                        <p style="font-size: 12px;">{$v['time']}</p>
                        <br>
                        <p >{:replace_weibo($v['content'])}</p>
                        <!--</div>-->

                        <!--<br>-->
                        <ul class="slides col-md-4" style="margin-top: 10px;">
                            {volist name=" explode(',',$v['path'])" id="y"}
                            <?php if($y!=null){?>
                            <li>

                                <div class="w3agile_special_deals_grid_left_grid">
                                    <a href="#"><img src="{$y}" class="img-responsive"
                                                     width="780" style="height: 200px!important"/></a>
                                </div>
                            </li>
                            <?php } ?>
                            {/volist}
                        </ul>
                    </div>

                </div>
                <div class="col-md-1" ></div>
                <div class="col-md-11" >
                    <ul class="col-md-6">
                        <li data-toggle="modal" data-target="#exampleModal" style="float: left; margin-left:10px;"><a ><i  class="fa fa-share turn-btn" aria-hidden="true" data-id="{$v['id']}"> &nbsp; {$v['transpondnum']}</i> </a></li>
                        <li style="float: left; margin-left:10px;"><a><i class="fa fa-thumbs-up agree-btn" aria-hidden="true" data-id="{$v['id']}"> &nbsp; {$v['agreenum']}</i></a></li>
                        <li data-toggle="modal" data-target="#exampleModal" style="float: left; margin-left:10px;"><a ><i class="fa fa-comment com-btn" aria-hidden="true" data-id="{$v['id']}"> &nbsp;  {$v['commentnum']}</i></a></li>
                    </ul>
                    <div class="col-md-6">
                        <a class="agileits w3layouts" href="{:url('index/show/index',['id'=>$v['id']])}" >查看详情 <span class="glyphicon agileits w3layouts glyphicon-arrow-right" aria-hidden="true"></span></a>
                    </div>
                </div>
            </div>
            <div class="clearfix"></div>
            <br><br>
            {else /}
            <div class="col-md-12" style="border: 1px solid #FFAC3A;width: 100% ;padding: 20px;">
                <div class="col-md-12">
                    <div class="col-md-4 w3agile-left">
                        <div class="comments-grid-left">
                            <img src="{$v['photo']}" style="width: 48px;height: 48px;"/>
                        </div>
                        <h5 style="margin-left:110px;font-size: 16px;color:#FFAC3A;">{$v['username']}</h5>

                        <p style="font-size: 12px;margin-left: 60px;">{$v['time']}</p>
                        <p style="margin-left: 100px">转发微博</p>

                    </div>
                    <div class="col-md-8 w3agile-right" style="margin: 0 auto;">
                        <p>{:replace_weibo($v['content'])}</p>
                    </div>
                </div>
                <div class="col-md-12" style="background: #eee">

                    <div class="col-md-1" >

                        <div class="comments-grid-left">
                            <img src="{$v['old']['photo']}" style="width: 48px;height: 48px;"/>
                        </div>
                    </div>
                    <div class="col-md-11" >
                        <br>
                        <h5 style="margin-left:50px;font-size: 16px;">{$v['old']['username']}</h5>
                        <p style="font-size: 12px;">{$v['time']}</p>
                        <br>
                        <p>{:replace_weibo($v['old']['content'])}</p>
                        <!--</div>-->

                        <!--<br>-->
                        <ul class="slides col-md-4" style="margin-top: 10px;">

                            <li>
                                <div class="w3agile_special_deals_grid_left_grid">
                                    {empty name="v['old']['path']"}
                                    {else /}

                                    <a href="{:url('index/show/index',['id'=>$v['old']['id']])}"><img src="{$v['old']['path']['path']}" class="img-responsive" alt="" width="780" style="height: 200px!important"/></a>
                                    {/empty}
                                </div>
                            </li>

                        </ul>
                    </div>

                </div>
                <div class="col-md-12"  style="background: #eee">
                    <div class="col-md-1">
                    </div>
                    <div class="col-md-11">
                        <ul class="col-md-6">
                            <li data-toggle="modal" data-target="#exampleModal" style="float: left; margin-left:10px;"><a><i
                                    class="fa fa-share turn-bt" aria-hidden="true" data-id="{$v['old']['id']}"> &nbsp;
                                {$v['transpondnum']}</i> </a></li>
                            <li style="float: left; margin-left:10px;"><a><i class="fa fa-thumbs-up agree-btn"
                                                                             aria-hidden="true" data-id="{$v['id']}"> &nbsp;
                                {$v['agreenum']}</i></a></li>
                            <li data-toggle="modal" data-target="#exampleModal" style="float: left; margin-left:10px;"><a><i
                                    class="fa fa-comment com-bt" aria-hidden="true" data-id="{$v['id']}"> &nbsp;
                                {$v['commentnum']}</i></a></li>

                        </ul>
                        <div class="col-md-6">
                            <a class="agileits w3layouts" href="{:url('index/show/index',['id'=>$v['id']])}">查看详情 <span
                                    class="glyphicon agileits w3layouts glyphicon-arrow-right"
                                    aria-hidden="true"></span></a>
                        </div>
                    </div>
                </div>
            </div>
            <hr>
            <br>
            {/empty}
            {/volist}
            <br>
            <br>

        </div>

    </div>




    <div class="col-md-3 w3agile_blog_left">
        <div class="wthreesearch">
            <form action="{:url('/wbSearch')}" method="post">
                <input type="search" name="Search" placeholder="Search here" required="">
                <button type="submit" class="btn btn-default search" aria-label="Left Align">
                    <i class="fa fa-search" aria-hidden="true"></i>
                </button>
            </form>

        </div>

        <div class="agileinfo_calender">

        </div>
        <div class="w3ls_popular_posts">
            <h3>TA发起的活动</h3>
            {volist name="articles" id="v"}
            <div class="agileits_popular_posts_grid">
                <div class="w3agile_special_deals_grid_left_grid">
                    <a href="{:url('/business/server', ['attentId'=>$attentId])}"><img src="{$v['thumbnail']}" class="img-responsive" style="width: 270px;height: 155px;"></a>
                </div>
                <h4><a href="{:url('/business/server', ['attentId'=>$attentId])}">{$v['title']}</a></h4>

                <h5><i class="fa fa-calendar" aria-hidden="true"></i>{$v['description']}</h5>
            </div>
            {/volist}

        </div>

        <div class="w3l_categories">
            <h3>微博认证</h3>
            <table class="table">
                <tr>
                    <th>{$info['username']}的微博认证</th>
                </tr>
            </table>
            <!--<ul class="list-group">-->
            <!--<li class="list-group-item">XXX的微博</li>-->
            <!--<li class="list-group-item">简介</li>-->
            <!--<li class="list-group-item">友情链接</li>-->
            <!--</ul>-->
        </div>
        <div class="w3ls_recent_posts">
            <h3>相册</h3>
            <div class="agileits_recent_posts_grid">
                <div class="agileits_recent_posts_gridl">

                    <div class="w3agile_special_deals_grid_left_grid">

                        <a href="{:url('/business/photo', ['attentId'=>$attentId])}"><img src="{$info['photo']}" class="img-responsive"
                                                                                          style="width: 81px;height: 55px;"/></a>

                    </div>


                </div>


                <div class="clearfix"></div>
            </div>
        </div>
        <div class="w3l_tags">
            <h3>微关系</h3>
            <ul class="tag">
                <h4>TA的关注</h4>
                <li>
                    {volist name="attent" id="v"}
                    <div class=" col-md-6">
                        <?php if($v['role']==2){?>
                        <a href="{:url('/business',['attentId'=>$v['attent_id']])}" style=" border: 1px solid #fff;">

                            <div class="thumbnail" style="border: #fff;">

                                <img src="{$v['photo']}" class="img-circle">
                                <div class="caption">
                                    <p>{$v['username']}</p>
                                </div>
                            </div>
                        </a>
                        <?php }else{?>
                        <a href="{:url('/other',['attent_id'=>$v['attent_id']])}" style=" border: 1px solid #fff;">

                            <div class="thumbnail" style="border: #fff;">

                                <img src="{$v['photo']}" class="img-circle">
                                <div class="caption">
                                    <p>{$v['username']}</p>
                                </div>
                            </div>
                        </a>
                        <?php }?>

                    </div>
                    {/volist}

                </li>
                <h4>TA的粉丝</h4>
                <li>
                    {volist name="fans" id="v"}
                    <div class=" col-md-6">
                        <?php if($v['role']==2){?>
                        <a href="{:url('/business',['attentId'=>$v['fans_id']])}" style=" border: 1px solid #fff;">
                            <div class="thumbnail" style="border: #fff;">
                                <img src="{$v['photo']}" class="img-circle">
                                <div class="caption">
                                    <p>{$v['username']}</p>
                                </div>
                            </div>
                        </a>
                        <?php }else{?>
                        <a href="{:url('/other',['attent_id'=>$v['fans_id']])}" style=" border: 1px solid #fff;">

                            <div class="thumbnail" style="border: #fff;">

                                <img src="{$v['photo']}" class="img-circle">
                                <div class="caption">
                                    <p>{$v['username']}</p>
                                </div>
                            </div>
                        </a>
                        <?php }?>
                    </div>
                    {/volist}
                </li>
            </ul>
        </div>
    </div>
    <!-- //btm-wthree-right -->
    <div class="clearfix"></div>
</div>
</div>

<!-- footer -->
<div class="footer-agile-info">
    <div class="container">
        <div class="col-md-4 w3layouts-footer">
            <h3>联系信息</h3>
            <p><span><i class="fa fa-map-marker" aria-hidden="true"></i></span>中华人民共和国上海市徐汇区</p>
            <p><span><i class="fa fa-envelope" aria-hidden="true"></i></span><a href="#">1551941489@qq.com</a> </p>
            <p><span><i class="fa fa-mobile" aria-hidden="true"></i></span>P: 03765759119 </p>
            <p><span><i class="fa fa-globe" aria-hidden="true"></i></span><a href="http://www.zhc1995.cn">W: www.zhc1995.cn</a></p>

        </div>
        <div class="col-md-4 wthree-footer">
            <h2>网站简介</h2>
            <p>本网站纯属娱乐,如作商业用途,请联系本人</p>
        </div>
        <div class="col-md-4 w3-agile">
            <h3>意见反馈</h3>
            <p>如果您有好的提议,前邮件联系作者</p>

        </div>
    </div>
</div>
<!-- footer -->
<div class="copyright">
    <div class="container">

        <div class="w3agile-list">

        </div>

        <div class="agileinfo">
            <p>版权 &copy; 魔狗工作室保留一切版权<a target="_blank" href="http://www.baidu.com">魔狗工作室</a>备案号:19001432</p>
        </div>
    </div>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">
                    已点赞
                </h4>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>


                <h4 class="modal-title" id="exampleModalLabel">转发</h4>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <label for="recipient-name" class="control-label">原微博</label>
                        <div class="username"></div>
                        <div class="form-control old" id="message-text"
                             style="border: solid #ccc 1px;height: 50px;"></div>

                        <input type="text" name="mid" value="" class="mid" hidden>
                    </div>
                    <div class="form-group">
                        <label for="message-text" class="control-label ">你的意见</label>
                        <textarea class="form-control new" id="message-text"></textarea>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <input type="hidden" id="type" name="type" value="{$type}">
                <button type="button" class="btn btn-default clos" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary turn">转发</button>
                <button type="button" class="btn btn-primary commen" style="display: none">评论</button>

            </div>
        </div>
    </div>
</div>
<!-- //copyright -->
<script src="/static/index/js/toastr.min.js"></script>

<!-- here stars scrolling icon -->
<script type="text/javascript">
    var attentId = $('#attentId').val();
    var user_id="{:session('id')}";
    $(document).ready(function () {
        /*
            var defaults = {
            containerID: 'toTop', // fading element id
            containerHoverID: 'toTopHover', // fading element hover id
            scrollSpeed: 1200,
            easingType: 'linear'
            };
        */

        $().UItoTop({easingType: 'easeOutQuart'});
        $('.jump').click(function () {
            var name = $(this).attr('data-name');
            // var name = 1111;
            console.log("{:url('/index/talk/name')}?name='"+name+"'");
            window.location.href="{:url('/index/talk/name')}?name='"+name+"'";
        });

        //点击转发形式微博的转发按钮
        $('.turn-bt').click(function(){
            var content = $(this).parent().parent().parent().parent().parent().prev().children().next().children().next().next().next().next().html();
            // console.log(content);
            var username = $(this).parent().parent().parent().parent().parent().prev().children().next().children().next().html();
            // console.log(username);
            var mid = $(this).attr('data-id');
            console.log(mid);
            $('.old').html(content);
            $('.mid').val(mid);
            $('.username').html(username + ' : ');
            $('.turn').show();
            $('.commen').hide();
            $('#exampleModalLabel').html('转发');
            $('.new').val(' ');
        });

        //点击转发形式微博的评论按钮
        $('.com-bt').click(function(){
            var content = $(this).parent().parent().parent().parent().parent().prev().children().next().children().next().next().next().next().html();
            var username = $(this).parent().parent().parent().parent().parent().prev().children().next().children().next().html();
            // console.log(username);
            var mid = $(this).attr('data-id');

            $('.old').html(content);
            $('.mid').val(mid);
            //改变转发按钮为评论按钮
            $('.turn').hide();
            $('.commen').show();
            $('.username').html(username + ' : ');
            $('.new').val(' ');
            $('#exampleModalLabel').html('评论');
        });




        //转发按钮
        $('.turn-btn').click(function () {
            var content = $(this).parent().parent().parent().parent().prev().prev().children().children().next().next().next().next().html();
            var username = $(this).parent().parent().parent().parent().prev().prev().children().children().next().html();
            var mid = $(this).attr('data-id');
            // console.log(content);
            $('.old').html(content);
            $('.mid').val(mid);
            $('.username').html(username + ' : ');
            $('.turn').show();
            $('.commen').hide();
            $('#exampleModalLabel').html('转发');
            $('.new').val(' ');

        });
        //点击转发
        $('.turn').click(function () {
            var oldContent = $('.old').val();
            var mid = $('.mid').val();
            var content = $('.new').val();
            var type = $('#type').val();
            $('.clos').click();
            // console.log(oldContent,mid,content);
            //执行ajax
            $.ajax({
                type: 'post',
                url: "/index/send/turn",
                contentType: 'application/x-www-form-urlencoded;charset=utf-8',
                data: {src_id: mid, content: content,type:type},
                dataType: 'json',
                success: function (data) {
                    // console.log(data);
                    if (data) {

                        toastr.success('参与活动成功!', '牛皮!:');
                    } else {

                        toastr.error('转发失败了', '不好意思哈: ');
                    }
                },
                error: function () {
                    toastr.error('AJAX 执行错误!', '警告:');
                }
            });


        });

        //点击评论
        $('.com-btn').click(function () {
            var content = $(this).parent().parent().parent().parent().prev().prev().children().children().next().next().next().next().html();
            var username = $(this).parent().parent().parent().parent().prev().prev().children().children().next().html();
            var mid = $(this).attr('data-id');
            $('.old').html(content);
            $('.mid').val(mid);
            //改变转发按钮为评论按钮
            $('.turn').hide();
            $('.commen').show();
            $('.username').html(username + ' : ');
            $('.new').val(' ');
            $('#exampleModalLabel').html('评论');
        })
        //点击评论按钮
        $('.commen').click(function () {
            var oldContent = $('.old').val();
            var mid = $('.mid').val();
            var content = $('.new').val();

            $('.clos').click();
            // console.log(oldContent,mid,content);
            //执行ajax
            $.ajax({
                type: 'post',
                url: "/index/content/content",
                contentType: 'application/x-www-form-urlencoded;charset=utf-8',
                data: {mid: mid, content: content},
                dataType: 'json',
                success: function (data) {
                    // console.log(data);
                    if (data) {
                        $('.new').val('');
                        toastr.success('已评论', '牛皮!:');
                    } else {
                        toastr.error('评论失败了', '不好意思哈: ');
                    }
                },
                error: function () {
                    toastr.error('AJAX 执行错误!', '警告:');
                }
            });
        });

    });

    $(function () {
        // 触发点赞操作
        $('.agree-btn').click(function () {

            var mid = $(this).attr('data-id');
            // $(this).text('11111');
            res = $(this);

            $.ajax({
                type: 'get',
                url: "/index/send/agree/" + mid,
                dataType: 'json',
                success: function (data) {
                    // console.log(data);
                    if (data[0] == 1) {
                        toastr.success('已赞');
                        // console.log(res);
                        res.html(' &nbsp; ' + data[1]);
                    } else if (data[0] == 0) {
                        toastr.error('最多只能赞一次哦', '不好意思哈: ');
                    } else if (data[0] == 2) {
                        window.location.href = "{:url('login/index')}";
                    }
                },
                error: function () {

                    toastr.error('AJAX 执行错误!', '警告:');
                }
            });

            //触发转发操作
        });

        //
        // $('.show-btn').click(function () {
        //     var ac_id = $(this).attr('data-id');
        //     console.log('查询ID为: ' + ac_id);
        //     //  执行查询
        //     showAjax(ac_id);
        // });




    });
    $(function () {
        var attentStatus = '{$attentStatus}';
        switch (attentStatus) {
            case "1":
                $('#unAttent').css('display','block');
                $('#attent').css('display','none');
                $('#bothAttent').css('display','none');
                break;
            case "2":
                $('#attent').css('display','block');
                $('#unAttent').css('display','none');
                $('#bothAttent').css('display','none');
                break;
            case "3":
                $('#bothAttent').css('display','block');
                $('#attent').css('display','none');
                $('#unAttent').css('display','none');
                break;
            default:
                break;
        }
    });

    function attent() {


        if (null==user_id||''==user_id) {
            alert("请先登录");
            window.location.href="{:url('index/login/index')}";
            //登录的地方
        }else{

            $.ajax({
                type: "get",
                data: { "attentId": attentId,"user_id":user_id},
                dataType: "json",
                // url:SCOPE.attent_url,
                url: '{:url(\'index/business/attent\')}',
                success: function (data) {
                    console.log("zslog 13.2 异步调用返回成功,result:" + data.id + data.attentId);
                    console.log("$attentStatus:" + data.attentStatus);
                    // debugger;
                    switch (data.attentStatus) {
                        case 1:
                            $('#unAttent').css('display','block');
                            $('#attent').css('display','none');
                            $('#bothAttent').css('display','none');
                            break;
                        case 2:
                            $('#attent').css('display','block');
                            $('#unAttent').css('display','none');
                            $('#bothAttent').css('display','none');
                            break;
                        case 3:
                            $('#bothAttent').css('display','block');
                            $('#attent').css('display','none');
                            $('#unAttent').css('display','none');
                            break;
                        default:
                            break;
                    }
                },
                error: function (XMLHttpResponse, textStatus, errorThrown) {
                    console.log("失败");
                }
            });

        }

    }

    function delAttent() {
        $.ajax({
            type: "get",
            data: { "attentId": attentId,
                "user_id":user_id},
            dataType: "json",
            // url:SCOPE.attent_url,
            url: '{:url(\'index/business/delAttent\')}',
            success: function (data) {
                console.log("zslog 13.2 异步调用返回成功,result:" + data.id + data.attentId);
                console.log("$attentStatus:" + data.attentStatus);
                // debugger;
                switch (data.attentStatus) {
                    case 1:
                        $('#unAttent').css('display','block');
                        $('#attent').css('display','none');
                        $('#bothAttent').css('display','none');
                        break;
                    case 2:
                        $('#attent').css('display','block');
                        $('#unAttent').css('display','none');
                        $('#bothAttent').css('display','none');
                        break;
                    case 3:
                        $('#bothAttent').css('display','block');
                        $('#attent').css('display','none');
                        $('#unAttent').css('display','none');
                        break;
                    default:
                        break;
                }
            },
            error: function (XMLHttpResponse, textStatus, errorThrown) {
                console.log("失败");
            }
        });
    }
    toastr.options = {
        closeButton: true,// 是否显示关闭按钮
        progressBar: true,// 实现显示计时条
        timeOut: "1000",  // 自动关闭时间
        positionClass: "toast-bottom-left" // 提示位置
        // toast-top-full-width 顶端，宽度铺满整个屏幕
        // toast-top-right  顶端右边
    };


    //触发转发操作




    //
    // $('.show-btn').click(function () {
    //     var ac_id = $(this).attr('data-id');
    //     console.log('查询ID为: ' + ac_id);
    //     //  执行查询
    //     showAjax(ac_id);
    // });


    //转发按钮
    $('.turn-btn').click(function () {
        var content = $(this).parent().parent().parent().parent().prev().prev().children().children().next().next().next().next().html();
        var username = $(this).parent().parent().parent().parent().prev().prev().children().children().next().html();
        var mid =$(this).attr('data-id');
        // console.log(mid);
        $('.old').html(content);
        $('.mid').val(mid);
        $('.username').html(username+' : ');
        $('.turn').show();
        $('.commen').hide();
        $('#exampleModalLabel').html('转发');
        $('.new').val(' ');

    });
    //点击转发
    $('.turn').click(function () {
        var oldContent = $('.old').val();
        var mid = $('.mid').val();
        var content = $('.new').val();

        $('.clos').click();
        // console.log(oldContent,mid,content);
        //执行ajax
        $.ajax({
            type: 'post',
            url: "/index/send/turn",
            contentType:'application/x-www-form-urlencoded;charset=utf-8',
            data:{src_id:mid,content:content},
            dataType: 'json',
            success: function (data) {
                // console.log(data);
                if (data) {

                    toastr.success('转发成功!','牛皮!:');
                } else {
                    toastr.success('未登录','抱歉!:');
                    window.location.href="{:url('login/index')}";
                }
            },
            error: function () {
                toastr.error('AJAX 执行错误!', '警告:');
            }
        });


    });

    //点击评论
    $('.com-btn').click(function () {
        var content = $(this).parent().parent().parent().parent().prev().prev().children().children().next().next().next().next().html();
        var username = $(this).parent().parent().parent().parent().prev().prev().children().children().next().html();
        var mid =$(this).attr('data-id');
        $('.old').html(content);
        $('.mid').val(mid);
        //改变转发按钮为评论按钮
        $('.turn').hide();
        $('.commen').show();
        $('.username').html(username+' : ');
        $('.new').val(' ');
        $('#exampleModalLabel').html('评论');
    })
    //点击评论按钮
    $('.commen').click(function () {
        var oldContent = $('.old').val();
        var mid = $('.mid').val();
        var content = $('.new').val();

        $('.clos').click();
        // console.log(oldContent,mid,content);
        //执行ajax
        $.ajax({
            type: 'post',
            url: "/index/content/content",
            contentType:'application/x-www-form-urlencoded;charset=utf-8',
            data:{mid:mid,content:content},
            dataType: 'json',
            success: function (data) {
                // console.log(data);
                if (data) {
                    $('.new').val('');
                    toastr.success('已评论','牛皮!:');
                } else {
                    window.location.href="{:url('login/index')}";

                }
            },
            error: function () {
                toastr.error('AJAX 执行错误!', '警告:');
            }
        });
    });


</script>
<!-- //here ends scrolling icon -->

<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="/static/index/js/bootstrap.js"></script>
</body>
</html>